#ifndef RELAYER_H__
#define RELAYER_H__

#define REL_JOBMAX 10000

enum
{
  STATE_RUNNING = 1,
  STATE_CANCELED,
  STATE_OVER
};

struct rel_stat_st
{
  int state;
  int fd1;
  int fd2;
  int64_t count12;
  int64_t count21;
};

/* add a job to array, return the index of the job in the array if success */
int rel_addjob(int fd1, int fd2);

/* cancel a job in array, return the job state in rel_stat */
int rel_canceljob(int index, struct rel_stat_st *rel_stat);

int rel_statjob(int index, struct rel_stat_st *rel_stat);

#endif
